define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'group.master/index',
        add_url: 'group.master/add',
        edit_url: 'group.master/edit',
        delete_url: 'group.master/delete',
        export_url: 'group.master/export',
        modify_url: 'group.master/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id'},
                    {field: 'user_id', title: '团长用户id'},
                    {field: 'true_name', title: '团长真实姓名'},
                    {field: 'id_card', title: '身份证号码'},
                    {field: 'mobile', title: '手机号'},
                    {field: 'members', title: '团员数量'},
                    {field: 'pid', title: '上级团长id'},
                    {field: 'master_addr_id', title: '团长地址id'},
                    {field: 'store_id', title: '团长所属门店id'},
                    {field: 'collage_goods_id', title: '拼团商品id'},
                    {field: 'verification_id', title: '核销员id'},
                    {field: 'register_time', title: '申请时间'},
                    {field: 'audit_time', title: '审核时间'},
                    {field: 'integral', title: '积分'},
                    {field: 'sales_volume', title: '销售额度'},
                    {field: 'is_delivery', title: '是否可以送货上门 0-是 1-否'},
                    {field: 'delivery_fee', title: '配送费'},
                    {field: 'pay_mode', title: '付款方式 0-微信支付 1-支付宝支付 2-银联支付 3-到货付款 4-余额支付'},
                    {field: 'audit_status', title: '审核状态 0-待审核 1-审核通过 2-审核未通过'},
                    {field: 'master_status', title: '团长状态 0-启用 1-禁用'},
                    {field: 'create_time', title: '创建时间'},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});